#include "Eigen/Dense"
#include "opencv2/opencv.hpp"
#include <stdint.h>

#define SHOW_DEBUG true

#define DMAX	(40)	//dM - 40mm
#define Dmax	(10)	//dm - 10mm
#define LAMDA	(20)


#define mWIDTH	(640)
#define mHEIGHT	(480)

#pragma once

struct Hypothesis 
{
	Eigen::Vector3f wirst_Position;
	Eigen::Vector3f wirst_Rotation;

	//Vec4[0] ~ rotation Z
	//Vec4[1]->Vec4[3] ~ rotation X
	Eigen::Vector4f thumb_Rotation;
	Eigen::Vector4f finger1_Rotation;
	Eigen::Vector4f finger2_Rotation;
	Eigen::Vector4f finger3_Rotation;
	Eigen::Vector4f little_Rotation;

	cv::Mat DepthMap;
};

class MatchingEstimator
{
public:
	MatchingEstimator(void);
	~MatchingEstimator(void);

	cv::Mat ObserveDepth;						//Od
	bool ObserveSkin[mHEIGHT][mWIDTH];			//Os

	bool rMatch[mHEIGHT][mWIDTH];				//Rm
	cv::Mat renderedDepth;						//Rd
	
	void createObserveSkin();
	void createRenderedMap();
	void getD();
	double getEstimation(Hypothesis h);
};

